const express = require('express')
const { createServer: createViteServer } = require('vite')

async function createServer () {
  const app = express()

  const vite = await createViteServer({
    server: {
      midddlewareMode: 'html'
    }
  })

  app.use(vite.middlewares)
  // app.use('*', async (req, res) => {

  // })

  app.listen(3000, () => {
    console.log('http://localhost:3000')
  })
}

createServer()
